package com.solutec.dia7;

import java.util.Random;

//import java.util.Random;

public class Aufgabe01_Zufallszahlen {

	public static void main(String[] args) {

		System.out.println(Math.random()); //[0 .. 1]
		
		for(int i=0;i<10; i++){
		
			// (int)(Math.random() * N) -> Zahlen aus [0 .. N-1]
			int zahl = (int)(Math.random() * 2);  
			
			System.out.print(zahl + " ");
		
		}
		
		System.out.println(   );

		System.out.println("------------------------------------------");
		
		
		java.util.Random random = new java.util.Random();
		
		for(int i=0;i<10;i++){
			
			int iN = 2;
			int zahl = random.nextInt(iN); // -> Zahlen aus [0 .. N-1]
			System.out.print(zahl + " ");
		}
		System.out.println();
		
		System.out.println("-------------------------------------------");
		
		
		printRandom(10, 20, 50);
		
		
	}//end of main
	
	static void printRandom(int min, int max, int count){
		Random random = new Random();
		
		for(int i = 0; i < count; i++){
			int num = random.nextInt(max-min+1)+min;
			System.out.print(num +" ");
		}
		System.out.println();
	}

}
